package com.wfm.leetcode.editor.cn;

import java.util.ArrayList;
import java.util.List;

public class POne431拥有最多糖果的孩子{
//leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
        List<Boolean> res = new ArrayList<>();
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < candies.length; i++) {
            max = Math.max(max,candies[i]);
        }
        for (int i = 0; i < candies.length; i++) {
            if(candies[i]+extraCandies>=max){
                res.add(true);
            }else {
                res.add(false);
            }
        }
        return res;
    }
}
//leetcode submit region end(Prohibit modification and deletion)

    public static void main(String[] args) { 
        Solution solution = new POne431拥有最多糖果的孩子().new Solution();
        List<Boolean> booleans = solution.kidsWithCandies(new int[]{2, 3, 5, 1, 3}, 3);
        System.out.println(booleans);
    }
}